package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.MerchantPledgeTaskRewardsConf;
import com.sc.nft.mapper.MerchantPledgeTaskRewardsConfMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商户质押任务奖励配置表(sc_merchant_pledge_task_rewards_conf)数据DAO
 *
 * @author Sun
 * @since 2023-08-24 16:16:49
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class MerchantPledgeTaskRewardsConfDao extends ServiceImpl<MerchantPledgeTaskRewardsConfMapper, MerchantPledgeTaskRewardsConf> {

    public List<MerchantPledgeTaskRewardsConf> getListByCycleConfId(Long id) {
        LambdaQueryWrapper<MerchantPledgeTaskRewardsConf> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MerchantPledgeTaskRewardsConf::getMerchantPledgeTaskCycleConfId,id);
        return list(wrapper);
    }

    public List<MerchantPledgeTaskRewardsConf> getListByIncomeConfId(Long incomeId) {
        LambdaQueryWrapper<MerchantPledgeTaskRewardsConf> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MerchantPledgeTaskRewardsConf::getMerchantPledgeTaskIncomeConfId,incomeId);
        return list(wrapper);
    }
}